package com.dhf.framework.system.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.dhf.framework.base.mybatis.core.page.Pagination;
import com.dhf.framework.common.BaseController;
import com.dhf.framework.system.entity.SysLog;
import com.dhf.framework.system.service.SysLogService;

 /**
 * </b>SysLogController<br>
 * @author minstar
 * @since2016年06月15日 16时19分39秒 星期三 
 * @version:1.0
 */
@Controller
@RequestMapping("/system/sysLog")
public class SysLogController extends BaseController{
		private static Logger LOGGER = LoggerFactory.getLogger(SysLogController.class);
	
  		@Autowired
  		private SysLogService sysLogService;
  		
  		/**
		  * 
		  * @Title: queryPageList
		  * @Description: 列表页面
		  * @param @param searchEntity
		  * @param @param pagination
		  * @return ModelAndView    返回类型
		  * @throws
		*/
		@RequestMapping(value = "/queryPageList")
		public ModelAndView queryPageList(SysLog sysLog, Pagination<SysLog> pagination) {
			LOGGER.debug(SysLogController.class.getName()+":开始查询分页数据！");
			ModelAndView mv = new ModelAndView( "system/sysLog/sysLogList" );
			pagination = this.sysLogService.queryPageList( sysLog, pagination );
			mv.addObject( "pagination", pagination );
			return mv;
		}
		
		
		/**
		 * 
		 * @Title: toMerge
		 * @Description: 详情页面
		 * @param @param entity
		 * @return ModelAndView    返回类型
		 * @throws
		 */
		@RequestMapping(value = "/toDetail")
		public ModelAndView toMerge(SysLog entity){
			ModelAndView mv = new ModelAndView("system/sysLog/sysLogDetail");
			if(entity.getId() != null){
				SysLog sysLog =  this.sysLogService.get( entity.getId() ) ;
				mv.addObject("sysLog",sysLog);
			}else{
				mv.addObject("sysLog", new SysLog());
			}
			return mv;
		}
}

